<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Installing on Windows</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="kvaser.gif"/></td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('section_install_windows.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">Installing on Windows </div>  </div>
</div><!--header-->
<div class="contents">
<div class="toc"><h3>Table of Contents</h3>
<ul><li class="level1"><a href="#section_install_driver_windows">Installing the Driver</a><ul><li class="level2"><a href="#section_install_virtual_device_windows">Installing Additional Virtual Devices</a></li>
<li class="level2"><a href="#section_uninstall_driver_windows">Removing the driver</a></li>
</ul>
</li>
<li class="level1"><a href="#section_install_sdk_windows">Installing Kvaser CANlib SDK</a><ul><li class="level2"><a href="#section_uninstall_sdk_windows">Removing Kvaser CANlib SDK</a></li>
</ul>
</li>
<li class="level1"><a href="#section_user_guide_build_installation_advanced_2">Installing using silent mode</a></li>
<li class="level1"><a href="#section_user_guide_build_installation_custom">Custom Driver Install</a></li>
<li class="level1"><a href="#section_user_guide_build_installation_verification_3">Troubleshooting</a></li>
<li class="level1"><a href="#section_user_guide_build_installation_debug">Using Debug DLLs</a></li>
</ul>
</div>
<div class="textblock"><p>We recommend that you install the drivers first, then the Kvaser CANlibSDK, and last install the hardware.</p>
<p>Starting with CANLIB 4.0, all drivers and other executable files are digitally signed by Kvaser using an Authenticode™ certificate. Starting with CANlib 5.20 all drivers are also digitally signed by Microsoft.</p>
<p>The latest versions of documentation, software and drivers can be downloaded for free at <a href="https://www.kvaser.com/download/">www.kvaser.com/download</a>.</p>
<h1><a class="anchor" id="section_install_driver_windows"></a>
Installing the Driver</h1>
<p>When upgrading the drivers, we recommend that you remove all Kvaser hardware before installing the update. In that way you can be sure that no applications are using the hardware and that no files are locked during the installation. The installation will work just fine even if you don't remove the hardware, but you might have to reboot before the new drivers are actually used.</p>
<p>If you are upgrading the drivers, you should under all circumstances <b>close all applications that use the CAN (or LIN)</b> bus before starting the upgrade.</p>
<p>To install the drivers, run the driver installation package. At present it is called <a href="https://www.kvaser.com/downloads-kvaser/?utm_source=software&amp;utm_ean=7330130980013&amp;utm_status=latest">kvaser_drivers_setup.exe</a> (direct link to latest version).</p>
<ol type="1">
<li>When you start the installation program, Windows will ask for the password of an account with administrative rights, or, if you are already logged into an account with such rights, you will be presented with a "consent dialog" that asks you for permission to continue.</li>
<li>Run the installation program. It will copy the driver files to your hard disk and register them with Windows.</li>
<li>The first time you install new Kvaser hardware of a particular type, Windows will display the "Found New Hardware Wizard". Since all the required driver files are already installed on your computer, all you need to do is to click the Next and OK buttons to complete the wizard. Windows will search for the driver files and will discover them automatically.</li>
</ol>
<dl class="section note"><dt>Note</dt><dd>Windows might ask you if you want to look on Windows Update for updated drivers. We recommend that you answer "No, not this time" - it will save you time.</dd>
<dd>
For the PCI and PCI Express cards you may need to reload the driver manually or restart your computer to get the system to use the new driver.</dd></dl>
<p>If you have trouble during installation, see <a class="el" href="section_install_windows.html#section_user_guide_build_installation_verification_3">Troubleshooting</a>.</p>
<h2><a class="anchor" id="section_install_virtual_device_windows"></a>
Installing Additional Virtual Devices</h2>
<p>By default, the Windows installer installs two Virtual Devices. If you need more, you can manually install additional Virtual Devices up to a maximum of 16. The first step is to increase the registry key "Computer\HKEY_LOCAL_MACHINE\SOFTWARE\KVASER AB\CANDriver 1.0\Drivers\kcanv\MaxCards" to the number of Virtual Devices needed.</p>
<div class="image">
<img src="reg_kcanv.png" alt="reg_kcanv.png"/>
<div class="caption">
Maximum number of allowed Virtual Devices is controlled by the MaxCards Registry Setting</div></div>
<p> To increase the maximum number of allowed Virtual Devices to 8, copy the code below to a textfile, name it to "SetMaxKvaserVirtualDevices.reg", and execute the file by double clicking on it. You can also do the changes directly in the registry with Regedit.exe.</p>
<div class="fragment"><div class="line">Windows Registry Editor Version 5.00</div><div class="line"></div><div class="line">[HKEY_LOCAL_MACHINE\SOFTWARE\KVASER AB\CANDriver 1.0\Drivers\kcanv]</div><div class="line"><span class="stringliteral">&quot;MaxCards&quot;</span>=dword:00000008</div><div class="line"><span class="stringliteral">&quot;DriverName&quot;</span>=<span class="stringliteral">&quot;kcanv&quot;</span></div></div><!-- fragment --><p>It is also possible to change the number of channels each Virtual Device has using the registry key "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\kcanv\Parameters\ChannelCount". By default, each Virtual Device has two channels.</p>
<div class="fragment"><div class="line">Windows Registry Editor Version 5.00</div><div class="line"></div><div class="line">[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\kcanv\Parameters]</div><div class="line"><span class="stringliteral">&quot;ChannelCount&quot;</span>=dword:00000002</div></div><!-- fragment --><dl class="section note"><dt>Note</dt><dd>A reboot of the system is required after changing the ChannelCount setting.</dd></dl>
<p>To add a Virtual Device, start the "Hardware Wizard", by pressing "Win + R", type HDWWIZ and click OK. Go through the "Hardware Wizard" and select:</p>
<ol type="1">
<li>Select "Install the hardware that I manually select from a list (Advanced)", and click Next</li>
<li>Select "CAN Hardware (Kvaser)", and click next</li>
<li>Scroll down in the list of device driver and select "Kvaser Virtual CAN Driver", click Next</li>
<li>Complete the installation by clicking Next and Finish.</li>
</ol>
<dl class="section note"><dt>Note</dt><dd>If you try and install more than 16 Kvaser Virtual CAN Drivers, the "Hardware Wizard" will notify you that "This device is not working properly because Windows cannot load the drivers required".</dd></dl>
<h2><a class="anchor" id="section_uninstall_driver_windows"></a>
Removing the driver</h2>
<p>To remove the installed drivers, simply uninstall them using the Windows Control Panel.</p>
<dl class="section note"><dt>Note</dt><dd>If you want to reinstall the drivers, a restart or power cycle may be needed in some cases between the uninstallation and the reinstallation. If the reinstallation fails, try to restart the computer and then run the installation again.</dd></dl>
<h1><a class="anchor" id="section_install_sdk_windows"></a>
Installing Kvaser CANlib SDK</h1>
<p>To install the Kvaser CANlib SDK, download and run the installation package. At present it is called <a href="https://www.kvaser.com/downloads-kvaser/?utm_source=software&amp;utm_ean=7330130980150&amp;utm_status=latest">canlib.exe</a> (direct link to latest version).</p>
<dl class="section note"><dt>Note</dt><dd>The CANlib SDK should not be installed on top of an already installed, older edition of CANlib SDK. You should install into a new directory, or uninstall the old version first.</dd>
<dd>
Take a note of where you install the Kvaser CANlib SDK, since this is needed in order to setup your IDE, see <a class="el" href="page_tutorial.html">Tutorials</a> for some examples.</dd></dl>
<h2><a class="anchor" id="section_uninstall_sdk_windows"></a>
Removing Kvaser CANlib SDK</h2>
<p>To remove the installed Kvaser CANlib SDK, simply uninstall using the Windows Control Panel.</p>
<h1><a class="anchor" id="section_user_guide_build_installation_advanced_2"></a>
Installing using silent mode</h1>
<p>You can run the installation packages in silent mode, meaning that no user interaction is required. (Please note that user action still is needed when inserting the hardware). To do this, use the /S switch when starting the installation, e.g.</p>
<p>kvaser_drivers_setup.exe /S</p>
<pre class="fragment">The installer may exit with an exit code:
0	Normal execution (no error)
1	Installation aborted by user (cancel button)
2	Installation aborted by script
100	The virtual CAN driver, and/or the network enumerator driver, failed to start.
	You should restart the computer and run the installation again.
101	Error: the installation needs administrative rights.
102	Error: the installation requires a later version of Windows.
103	Files were locked during the installation. A computer restart is required to
	complete the installation.
</pre><dl class="section note"><dt>Note</dt><dd>You will still get popup messages <b>from Windows</b> when the drivers are installed. This is by design - newer versions of Windows warn the user that privileged code is about to be installed. To avoid this you can do either of:<br />
<ul>
<li>Install Kvaser's certificate in the machine's Trusted Publisher store.</li>
<li>Deploy Kvaser's certificate automatically in a Windows domain using a GPO.</li>
<li>Click the Always trust software from Kvaser AB button. </li>
</ul>
</dd>
<dd>
These three things will give the same result, namely the installation of Kvaser's certificate in the Trusted Publisher store. The popup message will then not be showed.</dd></dl>
<h1><a class="anchor" id="section_user_guide_build_installation_custom"></a>
Custom Driver Install</h1>
<p>If you want to include the driver installation program with your application, or deploy them within your organization, you are welcome to do so but you are invited to contact us first at <a href="#" onclick="location.href='mai'+'lto:'+'sup'+'po'+'rt@'+'kv'+'ase'+'r.'+'com'; return false;">suppo<span style="display: none;">.nosp@m.</span>rt@k<span style="display: none;">.nosp@m.</span>vaser<span style="display: none;">.nosp@m.</span>.com</a> to discuss the technical details, join pre-release notification mailing lists and so on.</p>
<p>If you want to integrate the driver installation program into your own setup program, you can run it in silent mode by using the /S switch. All drivers will then be installed into their default location and no questions will be asked.</p>
<p>You can also run the installer with the /DISABLE switch to opt-out from installing certain parts of the driver package. The syntax is </p><div class="fragment"><div class="line">/DISABLE=section[,section...]</div></div><!-- fragment --><p> <b>Section</b> is one of:</p><ol type="1">
<li>GUI : the GUI tools, such as Kvaser Device Guide, the Blackbird configuration program, and the network device selector (also used toghether with Blackbird)</li>
<li>STARTMENU : the shortcuts in the Start Menu.</li>
<li>J2534 : registering of the J2534 driver.</li>
<li>ALL : all of the above as well as any sections that might be added in future releases.</li>
</ol>
<p>Example: </p><div class="fragment"><div class="line">kvaser_drivers_setup_whcp.exe /S /DISABLE=GUI,J2534</div></div><!-- fragment --><h1><a class="anchor" id="section_user_guide_build_installation_verification_3"></a>
Troubleshooting</h1>
<ul>
<li>Windows will display the "Found New Hardware Wizard" the first time you plug in a USB device in a USB port where a device of this type hasn't been used before. This is a design feature in Windows. If the "Found New Hardware Wizard" is displayed, just click the Next and OK buttons and let Windows search for the drivers. It will find them automatically.</li>
<li>If a device is marked with a yellow question mark in the Device Manager, try to right click at it and select Uninstall. Then physically remove the device and reinsert it, or reboot the computer. The "Found New Hardware Wizard" should then be displayed. As described above, just click the Next and OK buttons and let Windows reinstall the drivers automatically.</li>
<li>If the installation still seems to be faulty, check the <b>Control Panel | Kvaser Device Guide | Diagnostics tab</b>. Look for error messages. (These are clearly labeled as such.)</li>
<li>You should also check the <b>Control Panel | Administrative Tools | Event Log</b>. Errors from the driver routines are found in the System log. The Source column tells you which driver produced the error.</li>
<li>Many installation problems are solved by a reboot followed by a reinstallation of the driver package.</li>
<li>Many of our devices have LEDs that can tell you something about the health of the device. For example, a Kvaser Leaf or PCIcan II that flashes quickly (around one flash per second) with the green LED typically has a firmware configuration problem. The LED flashing is described in detail in the hardware manual of the device in question.</li>
<li>There are a number of scripts installed together with the drivers that can be useful when solving some more awkward problems. Go to the directory where you installed the drivers (typically c:\Program Files\Kvaser\Drivers) and read the file 00readme-scripts.txt.</li>
</ul>
<h1><a class="anchor" id="section_user_guide_build_installation_debug"></a>
Using Debug DLLs</h1>
<p>CANlib SDK is shipped with a number of debug DLLs and drivers; look in the …\sys\debug directory of the CANlib SDK. The debug DLLs will send information to the debugger (using the Win32 OutputDebugString API) and might help you in trouble-shooting your application or a particular installation.</p>
<p>To use the debug DLLs or drivers, you have to copy them yourself to the Windows system directory, overwriting the existing DLL or driver. Then remove and reinsert the hardware or restart the computer.</p>
<dl class="section note"><dt>Note</dt><dd>Never attempt to deploy the debug DLLs or drivers with your application. End users are likely not to appreciate it.</dd></dl>
<p>To see the debug information, you can use the excellent dbgview.exe program freely available from <a href="http://technet.microsoft.com/sysinternals">http://technet.microsoft.com/sysinternals</a>. </p>
</div></div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.13-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="page_installing.html">Installation</a></li>
    <li class="footer"> (canlib 5.38) Tue Feb 15 2022</li>
  </ul>
</div>
</body>
</html>
